<template>
  <el-row justify="center">
    <el-col :span="15">
      <h1>审批</h1>
      <el-form :model="form" label-width="100px">
        <el-form-item label="审批结果">
          <el-radio-group v-model="form.result" v-if="edit">
            <el-radio :label="true">通过</el-radio>
            <el-radio :label="false">驳回</el-radio>
          </el-radio-group>
          <template v-else>
            {{form.result ?'通过':'驳回'}}
          </template>
        </el-form-item>
        <el-form-item label="审批意见">
          <el-input v-model="form.detail" type="textarea"  placeholder="请填写审批意见，选填" :rows="5"  v-if="edit"></el-input>
          <template v-else>
            {{form.detail}}
          </template>
        </el-form-item>
      </el-form>
    </el-col>
  </el-row>
</template>

<script>
export default {
  name: "ApproveForm",
  props: {
    modelValue:Object,
    edit:Boolean
  },
  emits:['update:modelValue'],
  computed:{
    form:{
      get() {
        return this.modelValue
      },
      set(value) {
        this.$emit('update:modelValue', value)
      }
    }
  }
}
</script>

<style scoped>

</style>